//
//  SkuCollectionViewCell.swift
//  koolcar
//
//  Created by kuaimaxiansheng on 2022/8/5.
//

import UIKit

class SkuCollectionViewCell: UICollectionViewCell {
    
    var bgView: UIView!
    var titleLab: UILabel!
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        self.backgroundColor = .white
        self.clipsToBounds = true
        
        self.bgView = UIView.init(frame: CGRect.zero)
        self.bgView.backgroundColor = Theme.mainColor
        self.bgView.layer.cornerRadius = 16
        self.bgView.layer.masksToBounds = true
        self.bgView.layer.borderWidth = 1
        self.bgView.layer.borderColor = UIColor(hex: 0x939AA8,alpha: 0.12).cgColor
        self.contentView.addSubview(self.bgView)
        
        
        self.titleLab = UILabel.init(frame: CGRect.zero)
        self.titleLab.font = UIFont.init(name: Theme.PingFangSCRegular, size: 12)
        self.titleLab.textColor = Theme.titleLabColor
        self.titleLab.textAlignment = .center
        self.bgView.addSubview(self.titleLab)
        
        
        self.bgView.snp.makeConstraints { make in
            make.top.equalTo(0)
            make.left.equalTo(0)
            make.right.equalTo(0)
            make.bottom.equalTo(0)
        }
        
        self.titleLab.snp.makeConstraints { make in
            make.left.equalTo(5)
            make.right.equalTo(-5)
            make.height.equalTo(self.bgView.snp.height)
        }
        
    }
    
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
}
